 <include file="application/home/view/public/header.html"/>
      <!-- /.aside -->
      <section id="content">
        <section class="vbox">
          <section class="scrollable padder">
          
          </header>
          <form class="form-horizontal" data-validate="parsley">
                <section class="panel panel-default">
                 <header class="panel-heading"> <strong>收货地址</strong> </header>
                    <div class="panel-body">
                   
                      
                      <div class="line line-dashed line-lg pull-in"></div>
                      <div class="form-group">
                        <label class="col-sm-3 control-label">收件人:</label>
                        <div class="col-lg-4">
                         <input type="text" class="form-control" name="linkman" id="linkman"/>
                        </div>
                      </div>


                      

                      <div class="line line-dashed line-lg pull-in"></div>
                      <div class="form-group">
                        <label class="col-sm-3 control-label">电话号码:</label>
                        <div class="col-lg-4">
                         <input type="text" class="form-control" name="phone" id="phone"/>
                        </div>
                      </div>

                    
                      

                      <div class="line line-dashed line-lg pull-in"></div>
                      <div class="form-group">
                        <label class="col-sm-3 control-label">收货地址:</label>
                        <div class="col-lg-4">
                          <select name="pro" id="pro" >
							<option>--请选择城市--</option>
						        <foreach name="region" item="v">
							   		<option value="{$v.areaId}">{$v.areaName}</option>
							    </foreach>
						    </select>
						    <select name="city" id="city">
						        <option></option>
						    </select>
						    <select name="area" id="area">
						        <option></option>
						    </select>
                        </div>
                      </div>



                      <div class="line line-dashed line-lg pull-in"></div>
                      <div class="form-group">
                        <label class="col-sm-3 control-label">邮编:</label>
                        <div class="col-lg-4">
                        	<input type="text" class="form-control" name="code" id="code"/>
                        </div>
                      </div>

                      <div class="line line-dashed line-lg pull-in"></div>
                      <div class="form-group">
                        <label class="col-sm-3 control-label">详细地址:</label>
                        <div class="col-lg-4">
                        	<input type="text" class="form-control" name="address" id="address"/>
                        </div>
                      </div>

                    </div>
                    <footer class="panel-footer text-right bg-light lter">
                      <button type="button" class="btn btn-success btn-s-xs" onclick="sub()" >提 交</button>
                    </footer>
                  </section>
          </form>
          </section>
        </section>
        <a href="#" class="hide nav-off-screen-block" data-toggle="class:nav-off-screen" data-target="#nav"></a> </section>
      <aside class="bg-light lter b-l aside-md hide" id="notes">
        <div class="wrapper">Notification</div>
      </aside>
    </section>
  </section>
</section>
<script src="__PUBLIC__/home/js/app.v2.js"></script> 

<!-- Bootstrap --> <!-- App --> 
<script src="__PUBLIC__/home/js/charts/easypiechart/jquery.easy-pie-chart.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/charts/sparkline/jquery.sparkline.min.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/charts/flot/jquery.flot.min.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/charts/flot/jquery.flot.tooltip.min.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/charts/flot/jquery.flot.resize.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/charts/flot/jquery.flot.grow.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/charts/flot/demo.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/calendar/bootstrap_calendar.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/calendar/demo.js" cache="false"></script> 
<script src="__PUBLIC__/home/js/sortable/jquery.sortable.js" cache="false"></script>
<script src="__PUBLIC__/js/layer/layer.js" type="text/javascript"></script>
</body>
</html>

  <script>
    $('#pro').change(function(){
    	var url = "{:U('Address/Insert')}";
    	var pro_id = $('#pro').val();
    	$.post(url,{'pro_id':pro_id},function(data){
    		 $('#city').html(data);
    	});
    });
    $('#city').change(function(){
    	var url = "{:U('Address/Insert')}";
    	var pro_id = $('#city').val();
    	$.post(url,{'pro_id':pro_id},function(data){
    		 $('#area').html(data);
    	});
    }); 	
</script>
 <script>
 	function sub(){
			var url="{:U('Address/DoInsert')}";
			var sheng = $("#pro").val();
			var shi = $("#city").val();
			var qu = $("#area").val();
			var code = $("#code").val();
			var address = $("#address").val();
			var linkman = $("#linkman").val();
			var phone = $("#phone").val();
			if(linkman==""||phone==""||address==""||sheng==""||shi==""||code=="" ){
				layer.msg("请补全信息", {
			 		time: 1500, 
				});	
				return;
			}
			$.post(url,{'linkman':linkman,'phone':phone,'address':address,"sheng":sheng,"shi":shi,"qu":qu,"code":code},function(data){
				if(data.status<0){
					layer.msg(data.info);		
				}else{
					layer.msg(data.info);
					setTimeout(function () { 
				        window.location.href=""
				    }, 2000);
					
				}
			
			});	
		}
 </script>
